﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Raona.Code.Contracts.EventArguments;
using Raona.Code.Model;

namespace Raona.Code.Contracts.Generation
{
    /// <summary>
    /// The interface all text template-based generators must satisfy
    /// </summary>
    public interface ITemplateGenerator
    {
        #region Events

        /// <summary>
        /// Signals the completion of a step during the generation process
        /// </summary>
        event EventHandler<ProgressEventArgs> ProgressChanged;
        /// <summary>
        /// Signals the completion of the generation process
        /// </summary>
        event EventHandler<GenerationResultEventArgs> ProcessFinished;

        #endregion

        #region Properties
        
        /// <summary>
        /// The configuration parameters needed during the generation process
        /// </summary>
        string Configuration { set; }
        /// <summary>
        /// The interfaces needed during the generation process
        /// </summary>
        IEnumerable<Namespace> Namespaces { set; }
        /// <summary>
        /// The number of steps needed to complete the process
        /// </summary>
        int StepCount { get; }

        #endregion

        #region Methods

        /// <summary>
        /// Runs a generation process synchronously
        /// </summary>
        /// <returns></returns>
        Dictionary<string, List<GeneratedFile>> Generate();
        /// <summary>
        /// Starts the generation process asynchronously
        /// </summary>
        void GenerateAsync();
        /// <summary>
        /// Cancels the generation process
        /// </summary>
        void Cancel();
        
        #endregion
    }
}
